<template>
    <button @click="flag=!flag">switch</button>
    <LifeCycle v-if="flag"></LifeCycle>
</template>

<script>
import { ref } from '@vue/reactivity'
import LifeCycle from './components/LifeCycle.vue'
export default {
  components:{
    LifeCycle
  },
  setup(){
    let flag=ref(true)
    return{
      flag
    }
  }
}
</script>

<style>

</style>